package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Reservation;
import com.zzyl.vo.ReservationRestCountVo;
import com.zzyl.vo.ReservationVo;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description ReservationMapper
 * @Author loe
 * @Date 2024-07-12
 */

@Mapper
public interface ReservationMapper {

    Integer getCancelledReservationCount(Long userId, LocalDateTime now);

    Page<ReservationVo> limitSearch(Long userId, Integer status);

    List<ReservationRestCountVo> getRestReservationCount(LocalDateTime localDateTime);

    int insert(Reservation reservation);

    void cancelReservation(Long id);

    void updateExpiredReservations(LocalDateTime time);
}
